const Footer = () => {
    const fn1 = (e) => {
        // 阻止默认行为
        e.preventDefault();
        console.log("footer按钮被点击了",e)
    }
    const fn2 = (e) => {
        console.log("footer按钮被点击了",e)
        //阻止右键鼠标的默认行为
        e.preventDefault();
        //阻止事件冒泡行为
        e.stopPropagation(); 
    }

    return (
        <div onClick={fn1} style={{background:"#3299cc"}}>
            <h1>Footer</h1>
            <button onContextMenu={fn2}>footer按钮</button>
            <p>阻止事件冒泡--阻止默认行为</p>
        </div>
    )
}
export default Footer;